/**
 * Created by Vector on 17/7/23.
 */

var http = require('http');
var url = require('url');
var querystring = require('querystring');

function start(route) {
    function onRequest(request,response) {
        var p = url.parse(request.url,true);

        console.log(p.path);
        console.log(p.query);

        console.log(p.query.name);
        // console.log('Request for' + pathname + 'received');


        // route(pathname);

        response.writeHead(200,{'Content-Type':'text/plain'});
        response.write('Hello World');
        response.end();
    }

    http.createServer(onRequest).listen(8888);
    console.log('Server already started.');
}

exports.start = start;